#include "cputfiledialog.h"
#include "ui_cputfiledialog.h"
#include "cfiletransfer.h"

CPutFileDialog::CPutFileDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CPutFileDialog)
{
    ui->setupUi(this);
}

CPutFileDialog::~CPutFileDialog()
{
    delete ui;
}

void CPutFileDialog::setConn(CLoginCfgMgr::TConnectItem& item)
{
    m_connItem = item;
    //qDebug() << m_connItem.m_ip;
    ui->putfileaddrEdit->setText(m_connItem.m_user+"@"+m_connItem.m_ip);
}

void CPutFileDialog::on_putfileButton_clicked()
{
    CFileTransfer::putFile(m_connItem
                           ,ui->toputfileEdit->text()
                           ,ui->putAddrEdit->text());
}
